<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.13"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>MRSL Motion Primitive Library: include/mpl_basis/trajectory.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">MRSL Motion Primitive Library
   &#160;<span id="projectnumber">1.2</span>
   </div>
   <div id="projectbrief">A motion primitive library for generating trajectory for mobile robots</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.13 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="dir_d44c64559bbebec7f509842c48db8b23.html">include</a></li><li class="navelem"><a class="el" href="dir_8b04de6a62aca813b0b7abde855cede7.html">mpl_basis</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="headertitle">
<div class="title">trajectory.h</div>  </div>
</div><!--header-->
<div class="contents">
<a href="trajectory_8h.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;</div><div class="line"><a name="l00006"></a><span class="lineno">    6</span>&#160;<span class="preprocessor">#ifndef MPL_TRAJECTORY_H</span></div><div class="line"><a name="l00007"></a><span class="lineno">    7</span>&#160;<span class="preprocessor">#define MPL_TRAJECTORY_H</span></div><div class="line"><a name="l00008"></a><span class="lineno">    8</span>&#160;</div><div class="line"><a name="l00009"></a><span class="lineno">    9</span>&#160;<span class="preprocessor">#include &lt;<a class="code" href="lambda_8h.html">mpl_basis/lambda.h</a>&gt;</span></div><div class="line"><a name="l00010"></a><span class="lineno">   10</span>&#160;<span class="preprocessor">#include &lt;<a class="code" href="primitive_8h.html">mpl_basis/primitive.h</a>&gt;</span></div><div class="line"><a name="l00011"></a><span class="lineno">   11</span>&#160;</div><div class="line"><a name="l00019"></a><span class="lineno">   19</span>&#160;<span class="keyword">template</span> &lt;<span class="keywordtype">int</span> Dim&gt;</div><div class="line"><a name="l00020"></a><span class="lineno"><a class="line" href="structCommand.html">   20</a></span>&#160;<span class="keyword">struct </span><a class="code" href="structCommand.html">Command</a> {</div><div class="line"><a name="l00021"></a><span class="lineno"><a class="line" href="structCommand.html#a90de7cf427b5cba982ac95543e2415f0">   21</a></span>&#160;  <a class="code" href="data__type_8h.html#a3a0c45655a5e009e56634ccde0c5c575">Vecf&lt;Dim&gt;</a> <a class="code" href="structCommand.html#a90de7cf427b5cba982ac95543e2415f0">pos</a>;      </div><div class="line"><a name="l00022"></a><span class="lineno"><a class="line" href="structCommand.html#a6a7db4d1eb44141050e3c7dc691b1732">   22</a></span>&#160;  <a class="code" href="data__type_8h.html#a3a0c45655a5e009e56634ccde0c5c575">Vecf&lt;Dim&gt;</a> <a class="code" href="structCommand.html#a6a7db4d1eb44141050e3c7dc691b1732">vel</a>;      </div><div class="line"><a name="l00023"></a><span class="lineno"><a class="line" href="structCommand.html#a1a0a22e1fece01c1b74e7d866197d90c">   23</a></span>&#160;  <a class="code" href="data__type_8h.html#a3a0c45655a5e009e56634ccde0c5c575">Vecf&lt;Dim&gt;</a> <a class="code" href="structCommand.html#a1a0a22e1fece01c1b74e7d866197d90c">acc</a>;      </div><div class="line"><a name="l00024"></a><span class="lineno"><a class="line" href="structCommand.html#a93524fa85b9db75468e838e1dabc8b89">   24</a></span>&#160;  <a class="code" href="data__type_8h.html#a3a0c45655a5e009e56634ccde0c5c575">Vecf&lt;Dim&gt;</a> <a class="code" href="structCommand.html#a93524fa85b9db75468e838e1dabc8b89">jrk</a>;      </div><div class="line"><a name="l00025"></a><span class="lineno"><a class="line" href="structCommand.html#a15c98ad12c57dc0a5cb0c2fc6ce8f039">   25</a></span>&#160;  <a class="code" href="data__type_8h.html#a7c99d9360fc6cac2762b786e2fb52266">decimal_t</a> <a class="code" href="structCommand.html#a15c98ad12c57dc0a5cb0c2fc6ce8f039">yaw</a>;      </div><div class="line"><a name="l00026"></a><span class="lineno"><a class="line" href="structCommand.html#a67386b9f647b7830288fe09e2f1e2f94">   26</a></span>&#160;  <a class="code" href="data__type_8h.html#a7c99d9360fc6cac2762b786e2fb52266">decimal_t</a> <a class="code" href="structCommand.html#a67386b9f647b7830288fe09e2f1e2f94">yaw_dot</a>;  </div><div class="line"><a name="l00027"></a><span class="lineno">   27</span>&#160;  <a class="code" href="data__type_8h.html#a7c99d9360fc6cac2762b786e2fb52266">decimal_t</a> t;        </div><div class="line"><a name="l00028"></a><span class="lineno">   28</span>&#160;};</div><div class="line"><a name="l00029"></a><span class="lineno">   29</span>&#160;</div><div class="line"><a name="l00031"></a><span class="lineno"><a class="line" href="trajectory_8h.html#a584da4e5e2d62a2f438ce837015884e1">   31</a></span>&#160;<span class="keyword">typedef</span> <a class="code" href="structCommand.html">Command&lt;2&gt;</a> <a class="code" href="trajectory_8h.html#a584da4e5e2d62a2f438ce837015884e1">Command2D</a>;</div><div class="line"><a name="l00032"></a><span class="lineno">   32</span>&#160;</div><div class="line"><a name="l00034"></a><span class="lineno"><a class="line" href="trajectory_8h.html#a630e8754d18d9d0b2e32fe0cecd3fe3d">   34</a></span>&#160;<span class="keyword">typedef</span> <a class="code" href="structCommand.html">Command&lt;3&gt;</a> <a class="code" href="trajectory_8h.html#a630e8754d18d9d0b2e32fe0cecd3fe3d">Command3D</a>;</div><div class="line"><a name="l00035"></a><span class="lineno">   35</span>&#160;</div><div class="line"><a name="l00042"></a><span class="lineno">   42</span>&#160;<span class="keyword">template</span> &lt;<span class="keywordtype">int</span> Dim&gt;</div><div class="line"><a name="l00043"></a><span class="lineno"><a class="line" href="classTrajectory.html">   43</a></span>&#160;<span class="keyword">class </span><a class="code" href="classTrajectory.html">Trajectory</a> {</div><div class="line"><a name="l00044"></a><span class="lineno">   44</span>&#160; <span class="keyword">public</span>:</div><div class="line"><a name="l00048"></a><span class="lineno"><a class="line" href="classTrajectory.html#a28d57dbc2b417e504bede1abbd772544">   48</a></span>&#160;  <a class="code" href="classTrajectory.html#a28d57dbc2b417e504bede1abbd772544">Trajectory</a>() : total_t_(0) {}</div><div class="line"><a name="l00052"></a><span class="lineno"><a class="line" href="classTrajectory.html#a261644c545eae2262753edb6aab27798">   52</a></span>&#160;  <a class="code" href="classTrajectory.html#a261644c545eae2262753edb6aab27798">Trajectory</a>(<span class="keyword">const</span> <a class="code" href="data__type_8h.html#a6b9210d48a0a541940af71827aad1b41">vec_E</a>&lt;<a class="code" href="classPrimitive.html">Primitive&lt;Dim&gt;</a>&gt; &amp;prs) : segs(prs) {</div><div class="line"><a name="l00053"></a><span class="lineno">   53</span>&#160;    taus.push_back(0);</div><div class="line"><a name="l00054"></a><span class="lineno">   54</span>&#160;    <span class="keywordflow">for</span> (<span class="keyword">const</span> <span class="keyword">auto</span> &amp;pr : prs) taus.push_back(pr.t() + taus.back());</div><div class="line"><a name="l00055"></a><span class="lineno">   55</span>&#160;    Ts = taus;</div><div class="line"><a name="l00056"></a><span class="lineno">   56</span>&#160;    total_t_ = taus.back();</div><div class="line"><a name="l00057"></a><span class="lineno">   57</span>&#160;  }</div><div class="line"><a name="l00058"></a><span class="lineno">   58</span>&#160;</div><div class="line"><a name="l00067"></a><span class="lineno"><a class="line" href="classTrajectory.html#aec62c9d9b1a35202df2072ea3efcef09">   67</a></span>&#160;  <a class="code" href="structWaypoint.html">Waypoint&lt;Dim&gt;</a> <a class="code" href="classTrajectory.html#aec62c9d9b1a35202df2072ea3efcef09">evaluate</a>(<a class="code" href="data__type_8h.html#a7c99d9360fc6cac2762b786e2fb52266">decimal_t</a> time)<span class="keyword"> const </span>{</div><div class="line"><a name="l00068"></a><span class="lineno">   68</span>&#160;    <a class="code" href="data__type_8h.html#a7c99d9360fc6cac2762b786e2fb52266">decimal_t</a> tau = lambda_.getTau(time);</div><div class="line"><a name="l00069"></a><span class="lineno">   69</span>&#160;    <span class="keywordflow">if</span> (tau &lt; 0) tau = 0;</div><div class="line"><a name="l00070"></a><span class="lineno">   70</span>&#160;    <span class="keywordflow">if</span> (tau &gt; total_t_) tau = total_t_;</div><div class="line"><a name="l00071"></a><span class="lineno">   71</span>&#160;</div><div class="line"><a name="l00072"></a><span class="lineno">   72</span>&#160;    <span class="keywordflow">for</span> (<span class="keywordtype">size_t</span> <span class="keywordtype">id</span> = 0; <span class="keywordtype">id</span> &lt; segs.size(); <span class="keywordtype">id</span>++) {</div><div class="line"><a name="l00073"></a><span class="lineno">   73</span>&#160;      <span class="keywordflow">if</span> ((tau &gt;= taus[<span class="keywordtype">id</span>] &amp;&amp; tau &lt; taus[<span class="keywordtype">id</span> + 1]) || <span class="keywordtype">id</span> == segs.size() - 1) {</div><div class="line"><a name="l00074"></a><span class="lineno">   74</span>&#160;        tau -= taus[id];</div><div class="line"><a name="l00075"></a><span class="lineno">   75</span>&#160;        <a class="code" href="structWaypoint.html">Waypoint&lt;Dim&gt;</a> p(segs[<span class="keywordtype">id</span>].control());</div><div class="line"><a name="l00076"></a><span class="lineno">   76</span>&#160;        <span class="keywordflow">for</span> (<span class="keywordtype">int</span> j = 0; j &lt; Dim; j++) {</div><div class="line"><a name="l00077"></a><span class="lineno">   77</span>&#160;          <span class="keyword">const</span> <span class="keyword">auto</span> pr = segs[id].pr(j);</div><div class="line"><a name="l00078"></a><span class="lineno">   78</span>&#160;          p.<a class="code" href="structWaypoint.html#af63de420a521f105eea4ce098a51ad7e">pos</a>(j) = pr.p(tau);</div><div class="line"><a name="l00079"></a><span class="lineno">   79</span>&#160;          p.<a class="code" href="structWaypoint.html#a91393e0d8d73afb9df512710e56f02a5">vel</a>(j) = pr.v(tau);</div><div class="line"><a name="l00080"></a><span class="lineno">   80</span>&#160;          p.<a class="code" href="structWaypoint.html#a648217ed387d4e226bec8ecb05bfefe8">acc</a>(j) = pr.a(tau);</div><div class="line"><a name="l00081"></a><span class="lineno">   81</span>&#160;          p.<a class="code" href="structWaypoint.html#a7966bc3955c4c0f880eea35a76e4c8ed">jrk</a>(j) = pr.j(tau);</div><div class="line"><a name="l00082"></a><span class="lineno">   82</span>&#160;          p.<a class="code" href="structWaypoint.html#ad5c2f2b8f6dba96bb93faccde844e9a8">yaw</a> = normalize_angle(segs[<span class="keywordtype">id</span>].pr_yaw().p(tau));</div><div class="line"><a name="l00083"></a><span class="lineno">   83</span>&#160;        }</div><div class="line"><a name="l00084"></a><span class="lineno">   84</span>&#160;        <span class="keywordflow">return</span> p;</div><div class="line"><a name="l00085"></a><span class="lineno">   85</span>&#160;      }</div><div class="line"><a name="l00086"></a><span class="lineno">   86</span>&#160;    }</div><div class="line"><a name="l00087"></a><span class="lineno">   87</span>&#160;</div><div class="line"><a name="l00088"></a><span class="lineno">   88</span>&#160;    printf(<span class="stringliteral">&quot;cannot find tau according to time: %f\n&quot;</span>, time);</div><div class="line"><a name="l00089"></a><span class="lineno">   89</span>&#160;    <span class="keywordflow">return</span> <a class="code" href="structWaypoint.html">Waypoint&lt;Dim&gt;</a>();</div><div class="line"><a name="l00090"></a><span class="lineno">   90</span>&#160;  }</div><div class="line"><a name="l00091"></a><span class="lineno">   91</span>&#160;</div><div class="line"><a name="l00099"></a><span class="lineno"><a class="line" href="classTrajectory.html#a4a31376506a13df82691e2f67125f25e">   99</a></span>&#160;  <span class="keywordtype">bool</span> <a class="code" href="classTrajectory.html#a4a31376506a13df82691e2f67125f25e">evaluate</a>(<a class="code" href="data__type_8h.html#a7c99d9360fc6cac2762b786e2fb52266">decimal_t</a> time, <a class="code" href="structCommand.html">Command&lt;Dim&gt;</a> &amp;p)<span class="keyword"> const </span>{</div><div class="line"><a name="l00100"></a><span class="lineno">  100</span>&#160;    <a class="code" href="data__type_8h.html#a7c99d9360fc6cac2762b786e2fb52266">decimal_t</a> tau = lambda_.getTau(time);</div><div class="line"><a name="l00101"></a><span class="lineno">  101</span>&#160;    <span class="keywordflow">if</span> (tau &lt; 0) tau = 0;</div><div class="line"><a name="l00102"></a><span class="lineno">  102</span>&#160;    <span class="keywordflow">if</span> (tau &gt; total_t_) tau = total_t_;</div><div class="line"><a name="l00103"></a><span class="lineno">  103</span>&#160;</div><div class="line"><a name="l00104"></a><span class="lineno">  104</span>&#160;    <a class="code" href="data__type_8h.html#a7c99d9360fc6cac2762b786e2fb52266">decimal_t</a> lambda = 1;</div><div class="line"><a name="l00105"></a><span class="lineno">  105</span>&#160;    <a class="code" href="data__type_8h.html#a7c99d9360fc6cac2762b786e2fb52266">decimal_t</a> lambda_dot = 0;</div><div class="line"><a name="l00106"></a><span class="lineno">  106</span>&#160;</div><div class="line"><a name="l00107"></a><span class="lineno">  107</span>&#160;    <span class="keywordflow">if</span> (lambda_.exist()) {</div><div class="line"><a name="l00108"></a><span class="lineno">  108</span>&#160;      <a class="code" href="structVirtualPoint.html">VirtualPoint</a> vt = lambda_.evaluate(tau);</div><div class="line"><a name="l00109"></a><span class="lineno">  109</span>&#160;      lambda = vt.p;</div><div class="line"><a name="l00110"></a><span class="lineno">  110</span>&#160;      lambda_dot = vt.v;</div><div class="line"><a name="l00111"></a><span class="lineno">  111</span>&#160;    }</div><div class="line"><a name="l00112"></a><span class="lineno">  112</span>&#160;</div><div class="line"><a name="l00113"></a><span class="lineno">  113</span>&#160;    <span class="keywordflow">for</span> (<span class="keywordtype">size_t</span> <span class="keywordtype">id</span> = 0; <span class="keywordtype">id</span> &lt; segs.size(); <span class="keywordtype">id</span>++) {</div><div class="line"><a name="l00114"></a><span class="lineno">  114</span>&#160;      <span class="keywordflow">if</span> (tau &gt;= taus[<span class="keywordtype">id</span>] &amp;&amp; tau &lt;= taus[<span class="keywordtype">id</span> + 1]) {</div><div class="line"><a name="l00115"></a><span class="lineno">  115</span>&#160;        tau -= taus[id];</div><div class="line"><a name="l00116"></a><span class="lineno">  116</span>&#160;        <span class="keywordflow">for</span> (<span class="keywordtype">int</span> j = 0; j &lt; Dim; j++) {</div><div class="line"><a name="l00117"></a><span class="lineno">  117</span>&#160;          <span class="keyword">const</span> <span class="keyword">auto</span> pr = segs[id].pr(j);</div><div class="line"><a name="l00118"></a><span class="lineno">  118</span>&#160;          p.<a class="code" href="structCommand.html#a90de7cf427b5cba982ac95543e2415f0">pos</a>(j) = pr.p(tau);</div><div class="line"><a name="l00119"></a><span class="lineno">  119</span>&#160;          p.<a class="code" href="structCommand.html#a6a7db4d1eb44141050e3c7dc691b1732">vel</a>(j) = pr.v(tau) / lambda;</div><div class="line"><a name="l00120"></a><span class="lineno">  120</span>&#160;          p.<a class="code" href="structCommand.html#a1a0a22e1fece01c1b74e7d866197d90c">acc</a>(j) = pr.a(tau) / lambda / lambda -</div><div class="line"><a name="l00121"></a><span class="lineno">  121</span>&#160;                     p.<a class="code" href="structCommand.html#a6a7db4d1eb44141050e3c7dc691b1732">vel</a>(j) * lambda_dot / lambda / lambda / lambda;</div><div class="line"><a name="l00122"></a><span class="lineno">  122</span>&#160;          p.<a class="code" href="structCommand.html#a93524fa85b9db75468e838e1dabc8b89">jrk</a>(j) = pr.j(tau) / lambda / lambda -</div><div class="line"><a name="l00123"></a><span class="lineno">  123</span>&#160;                     3 / <a class="code" href="math_8h.html#a8a7fd3c51a3512fb0e8f4d70f8a93fac">power</a>(lambda, 3) * p.<a class="code" href="structCommand.html#a1a0a22e1fece01c1b74e7d866197d90c">acc</a>(j) * p.<a class="code" href="structCommand.html#a1a0a22e1fece01c1b74e7d866197d90c">acc</a>(j) * lambda_dot +</div><div class="line"><a name="l00124"></a><span class="lineno">  124</span>&#160;                     3 / <a class="code" href="math_8h.html#a8a7fd3c51a3512fb0e8f4d70f8a93fac">power</a>(lambda, 4) * p.<a class="code" href="structCommand.html#a6a7db4d1eb44141050e3c7dc691b1732">vel</a>(j) * lambda_dot * lambda_dot;</div><div class="line"><a name="l00125"></a><span class="lineno">  125</span>&#160;          p.<a class="code" href="structCommand.html#a15c98ad12c57dc0a5cb0c2fc6ce8f039">yaw</a> = normalize_angle(segs[<span class="keywordtype">id</span>].pr_yaw().p(tau));</div><div class="line"><a name="l00126"></a><span class="lineno">  126</span>&#160;          p.<a class="code" href="structCommand.html#a67386b9f647b7830288fe09e2f1e2f94">yaw_dot</a> = normalize_angle(segs[<span class="keywordtype">id</span>].pr_yaw().v(tau));</div><div class="line"><a name="l00127"></a><span class="lineno">  127</span>&#160;          p.t = time;</div><div class="line"><a name="l00128"></a><span class="lineno">  128</span>&#160;        }</div><div class="line"><a name="l00129"></a><span class="lineno">  129</span>&#160;        <span class="keywordflow">return</span> <span class="keyword">true</span>;</div><div class="line"><a name="l00130"></a><span class="lineno">  130</span>&#160;      }</div><div class="line"><a name="l00131"></a><span class="lineno">  131</span>&#160;    }</div><div class="line"><a name="l00132"></a><span class="lineno">  132</span>&#160;</div><div class="line"><a name="l00133"></a><span class="lineno">  133</span>&#160;    printf(<span class="stringliteral">&quot;cannot find tau according to time: %f\n&quot;</span>, time);</div><div class="line"><a name="l00134"></a><span class="lineno">  134</span>&#160;    <span class="keywordflow">return</span> <span class="keyword">false</span>;</div><div class="line"><a name="l00135"></a><span class="lineno">  135</span>&#160;  }</div><div class="line"><a name="l00136"></a><span class="lineno">  136</span>&#160;</div><div class="line"><a name="l00140"></a><span class="lineno"><a class="line" href="classTrajectory.html#a5f54099ed3abd448c571b20200f42b3a">  140</a></span>&#160;  <span class="keywordtype">bool</span> <a class="code" href="classTrajectory.html#a5f54099ed3abd448c571b20200f42b3a">scale</a>(<a class="code" href="data__type_8h.html#a7c99d9360fc6cac2762b786e2fb52266">decimal_t</a> ri, <a class="code" href="data__type_8h.html#a7c99d9360fc6cac2762b786e2fb52266">decimal_t</a> rf) {</div><div class="line"><a name="l00141"></a><span class="lineno">  141</span>&#160;    std::vector&lt;VirtualPoint&gt; vs;</div><div class="line"><a name="l00142"></a><span class="lineno">  142</span>&#160;    <a class="code" href="structVirtualPoint.html">VirtualPoint</a> vi, vf;</div><div class="line"><a name="l00143"></a><span class="lineno">  143</span>&#160;    vi.p = 1.0 / ri;</div><div class="line"><a name="l00144"></a><span class="lineno">  144</span>&#160;    vi.v = 0;</div><div class="line"><a name="l00145"></a><span class="lineno">  145</span>&#160;    vi.t = 0;</div><div class="line"><a name="l00146"></a><span class="lineno">  146</span>&#160;</div><div class="line"><a name="l00147"></a><span class="lineno">  147</span>&#160;    vf.p = 1.0 / rf;</div><div class="line"><a name="l00148"></a><span class="lineno">  148</span>&#160;    vf.v = 0;</div><div class="line"><a name="l00149"></a><span class="lineno">  149</span>&#160;    vf.t = taus.back();</div><div class="line"><a name="l00150"></a><span class="lineno">  150</span>&#160;</div><div class="line"><a name="l00151"></a><span class="lineno">  151</span>&#160;    vs.push_back(vi);</div><div class="line"><a name="l00152"></a><span class="lineno">  152</span>&#160;    vs.push_back(vf);</div><div class="line"><a name="l00153"></a><span class="lineno">  153</span>&#160;    <a class="code" href="classLambda.html">Lambda</a> ls(vs);</div><div class="line"><a name="l00154"></a><span class="lineno">  154</span>&#160;    lambda_ = ls;</div><div class="line"><a name="l00155"></a><span class="lineno">  155</span>&#160;    std::vector&lt;decimal_t&gt; ts;</div><div class="line"><a name="l00156"></a><span class="lineno">  156</span>&#160;    <span class="keywordflow">for</span> (<span class="keyword">const</span> <span class="keyword">auto</span> &amp;tau : taus) ts.push_back(lambda_.getT(tau));</div><div class="line"><a name="l00157"></a><span class="lineno">  157</span>&#160;    Ts = ts;</div><div class="line"><a name="l00158"></a><span class="lineno">  158</span>&#160;    total_t_ = Ts.back();</div><div class="line"><a name="l00159"></a><span class="lineno">  159</span>&#160;    <span class="keywordflow">return</span> <span class="keyword">true</span>;</div><div class="line"><a name="l00160"></a><span class="lineno">  160</span>&#160;  }</div><div class="line"><a name="l00161"></a><span class="lineno">  161</span>&#160;</div><div class="line"><a name="l00165"></a><span class="lineno"><a class="line" href="classTrajectory.html#a9bedf803b27daaca08d0e049a17fa41a">  165</a></span>&#160;  <span class="keywordtype">bool</span> <a class="code" href="classTrajectory.html#a9bedf803b27daaca08d0e049a17fa41a">scale_down</a>(<a class="code" href="data__type_8h.html#a7c99d9360fc6cac2762b786e2fb52266">decimal_t</a> mv, <a class="code" href="data__type_8h.html#a7c99d9360fc6cac2762b786e2fb52266">decimal_t</a> ri, <a class="code" href="data__type_8h.html#a7c99d9360fc6cac2762b786e2fb52266">decimal_t</a> rf) {</div><div class="line"><a name="l00166"></a><span class="lineno">  166</span>&#160;    std::vector&lt;VirtualPoint&gt; vs;</div><div class="line"><a name="l00167"></a><span class="lineno">  167</span>&#160;    <a class="code" href="structVirtualPoint.html">VirtualPoint</a> vi, vf;</div><div class="line"><a name="l00168"></a><span class="lineno">  168</span>&#160;    vi.p = ri;</div><div class="line"><a name="l00169"></a><span class="lineno">  169</span>&#160;    vi.v = 0;</div><div class="line"><a name="l00170"></a><span class="lineno">  170</span>&#160;    vi.t = 0;</div><div class="line"><a name="l00171"></a><span class="lineno">  171</span>&#160;</div><div class="line"><a name="l00172"></a><span class="lineno">  172</span>&#160;    vf.p = rf;</div><div class="line"><a name="l00173"></a><span class="lineno">  173</span>&#160;    vf.v = 0;</div><div class="line"><a name="l00174"></a><span class="lineno">  174</span>&#160;    vf.t = taus.back();</div><div class="line"><a name="l00175"></a><span class="lineno">  175</span>&#160;</div><div class="line"><a name="l00176"></a><span class="lineno">  176</span>&#160;    vs.push_back(vi);</div><div class="line"><a name="l00177"></a><span class="lineno">  177</span>&#160;    <span class="keywordflow">for</span> (<span class="keywordtype">int</span> <span class="keywordtype">id</span> = 0; <span class="keywordtype">id</span> &lt; (int)segs.size(); <span class="keywordtype">id</span>++) {</div><div class="line"><a name="l00178"></a><span class="lineno">  178</span>&#160;      <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i &lt; 3; i++) {</div><div class="line"><a name="l00179"></a><span class="lineno">  179</span>&#160;        <span class="keywordflow">if</span> (segs[<span class="keywordtype">id</span>].max_vel(i) &gt; mv) {</div><div class="line"><a name="l00180"></a><span class="lineno">  180</span>&#160;          std::vector&lt;decimal_t&gt; ts = segs[id].pr(i).extrema_vel(segs[<span class="keywordtype">id</span>].t());</div><div class="line"><a name="l00181"></a><span class="lineno">  181</span>&#160;          <span class="keywordflow">if</span> (<span class="keywordtype">id</span> != 0) ts.push_back(0);</div><div class="line"><a name="l00182"></a><span class="lineno">  182</span>&#160;          ts.push_back(segs[<span class="keywordtype">id</span>].t());</div><div class="line"><a name="l00183"></a><span class="lineno">  183</span>&#160;          <span class="keywordflow">for</span> (<span class="keyword">const</span> <span class="keyword">auto</span> &amp;tv : ts) {</div><div class="line"><a name="l00184"></a><span class="lineno">  184</span>&#160;            <a class="code" href="data__type_8h.html#a885809dc84c0c55d44fe4836f5cfa39b">Vec4f</a> p = segs[id].pr(i).evaluate(tv);</div><div class="line"><a name="l00185"></a><span class="lineno">  185</span>&#160;            <a class="code" href="data__type_8h.html#a7c99d9360fc6cac2762b786e2fb52266">decimal_t</a> v = p(1);</div><div class="line"><a name="l00186"></a><span class="lineno">  186</span>&#160;            <a class="code" href="data__type_8h.html#a7c99d9360fc6cac2762b786e2fb52266">decimal_t</a> lambda_v = fabs(v) / mv;</div><div class="line"><a name="l00187"></a><span class="lineno">  187</span>&#160;            <span class="keywordflow">if</span> (lambda_v &lt;= 1) <span class="keywordflow">continue</span>;</div><div class="line"><a name="l00188"></a><span class="lineno">  188</span>&#160;</div><div class="line"><a name="l00189"></a><span class="lineno">  189</span>&#160;            <a class="code" href="structVirtualPoint.html">VirtualPoint</a> vt;</div><div class="line"><a name="l00190"></a><span class="lineno">  190</span>&#160;            vt.p = lambda_v;</div><div class="line"><a name="l00191"></a><span class="lineno">  191</span>&#160;            vt.v = 0;</div><div class="line"><a name="l00192"></a><span class="lineno">  192</span>&#160;            vt.t = tv + taus[id];</div><div class="line"><a name="l00193"></a><span class="lineno">  193</span>&#160;            vs.push_back(vt);</div><div class="line"><a name="l00194"></a><span class="lineno">  194</span>&#160;          }</div><div class="line"><a name="l00195"></a><span class="lineno">  195</span>&#160;        }</div><div class="line"><a name="l00196"></a><span class="lineno">  196</span>&#160;      }</div><div class="line"><a name="l00197"></a><span class="lineno">  197</span>&#160;    }</div><div class="line"><a name="l00198"></a><span class="lineno">  198</span>&#160;</div><div class="line"><a name="l00199"></a><span class="lineno">  199</span>&#160;    vs.push_back(vf);</div><div class="line"><a name="l00200"></a><span class="lineno">  200</span>&#160;</div><div class="line"><a name="l00201"></a><span class="lineno">  201</span>&#160;    std::sort(</div><div class="line"><a name="l00202"></a><span class="lineno">  202</span>&#160;        vs.begin(), vs.end(),</div><div class="line"><a name="l00203"></a><span class="lineno">  203</span>&#160;        [](<span class="keyword">const</span> <a class="code" href="structVirtualPoint.html">VirtualPoint</a> &amp;i, <span class="keyword">const</span> <a class="code" href="structVirtualPoint.html">VirtualPoint</a> &amp;j) { <span class="keywordflow">return</span> i.t &lt; j.t; });</div><div class="line"><a name="l00204"></a><span class="lineno">  204</span>&#160;    <a class="code" href="data__type_8h.html#a7c99d9360fc6cac2762b786e2fb52266">decimal_t</a> max_l = 1;</div><div class="line"><a name="l00205"></a><span class="lineno">  205</span>&#160;    <span class="keywordflow">for</span> (<span class="keyword">const</span> <span class="keyword">auto</span> &amp;v : vs) {</div><div class="line"><a name="l00206"></a><span class="lineno">  206</span>&#160;      <span class="keywordflow">if</span> (v.p &gt; max_l) max_l = v.p;</div><div class="line"><a name="l00207"></a><span class="lineno">  207</span>&#160;    }</div><div class="line"><a name="l00208"></a><span class="lineno">  208</span>&#160;</div><div class="line"><a name="l00209"></a><span class="lineno">  209</span>&#160;    <span class="keywordflow">if</span> (max_l &lt;= 1) <span class="keywordflow">return</span> <span class="keyword">false</span>;</div><div class="line"><a name="l00210"></a><span class="lineno">  210</span>&#160;</div><div class="line"><a name="l00211"></a><span class="lineno">  211</span>&#160;    <span class="comment">// printf(&quot;max_l: %f\n&quot;, max_l);</span></div><div class="line"><a name="l00212"></a><span class="lineno">  212</span>&#160;    <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 1; i &lt; (int)vs.size() - 1; i++) vs[i].p = max_l;</div><div class="line"><a name="l00213"></a><span class="lineno">  213</span>&#160;    std::vector&lt;VirtualPoint&gt; vs_s;</div><div class="line"><a name="l00214"></a><span class="lineno">  214</span>&#160;    vs_s.push_back(vs.front());</div><div class="line"><a name="l00215"></a><span class="lineno">  215</span>&#160;    <span class="keywordflow">for</span> (<span class="keyword">const</span> <span class="keyword">auto</span> &amp;v : vs)</div><div class="line"><a name="l00216"></a><span class="lineno">  216</span>&#160;      <span class="keywordflow">if</span> (v.t &gt; vs_s.back().t) vs_s.push_back(v);</div><div class="line"><a name="l00217"></a><span class="lineno">  217</span>&#160;</div><div class="line"><a name="l00218"></a><span class="lineno">  218</span>&#160;    lambda_ = <a class="code" href="classLambda.html">Lambda</a>(vs_s);</div><div class="line"><a name="l00219"></a><span class="lineno">  219</span>&#160;</div><div class="line"><a name="l00220"></a><span class="lineno">  220</span>&#160;    std::vector&lt;decimal_t&gt; ts;</div><div class="line"><a name="l00221"></a><span class="lineno">  221</span>&#160;    <span class="keywordflow">for</span> (<span class="keyword">const</span> <span class="keyword">auto</span> &amp;tau : taus) ts.push_back(lambda_.getT(tau));</div><div class="line"><a name="l00222"></a><span class="lineno">  222</span>&#160;    Ts = ts;</div><div class="line"><a name="l00223"></a><span class="lineno">  223</span>&#160;    total_t_ = Ts.back();</div><div class="line"><a name="l00224"></a><span class="lineno">  224</span>&#160;    <span class="keywordflow">return</span> <span class="keyword">true</span>;</div><div class="line"><a name="l00225"></a><span class="lineno">  225</span>&#160;  }</div><div class="line"><a name="l00226"></a><span class="lineno">  226</span>&#160;</div><div class="line"><a name="l00230"></a><span class="lineno"><a class="line" href="classTrajectory.html#a25ec384d286281c81480dee1b2f7bffe">  230</a></span>&#160;  <a class="code" href="data__type_8h.html#a6b9210d48a0a541940af71827aad1b41">vec_E&lt;Command&lt;Dim&gt;</a>&gt; <a class="code" href="classTrajectory.html#a25ec384d286281c81480dee1b2f7bffe">sample</a>(<span class="keywordtype">int</span> N)<span class="keyword"> const </span>{</div><div class="line"><a name="l00231"></a><span class="lineno">  231</span>&#160;    <a class="code" href="data__type_8h.html#a6b9210d48a0a541940af71827aad1b41">vec_E&lt;Command&lt;Dim&gt;</a>&gt; ps(N + 1);</div><div class="line"><a name="l00232"></a><span class="lineno">  232</span>&#160;</div><div class="line"><a name="l00233"></a><span class="lineno">  233</span>&#160;    <a class="code" href="data__type_8h.html#a7c99d9360fc6cac2762b786e2fb52266">decimal_t</a> dt = total_t_ / N;</div><div class="line"><a name="l00234"></a><span class="lineno">  234</span>&#160;    <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i &lt;= N; i++) evaluate(i * dt, ps[i]);</div><div class="line"><a name="l00235"></a><span class="lineno">  235</span>&#160;</div><div class="line"><a name="l00236"></a><span class="lineno">  236</span>&#160;    <span class="keywordflow">return</span> ps;</div><div class="line"><a name="l00237"></a><span class="lineno">  237</span>&#160;  }</div><div class="line"><a name="l00238"></a><span class="lineno">  238</span>&#160;</div><div class="line"><a name="l00250"></a><span class="lineno"><a class="line" href="classTrajectory.html#a5e1f42b3d5a4efa3ec52e9ffebb5504d">  250</a></span>&#160;  <a class="code" href="data__type_8h.html#a7c99d9360fc6cac2762b786e2fb52266">decimal_t</a> <a class="code" href="classTrajectory.html#a5e1f42b3d5a4efa3ec52e9ffebb5504d">J</a>(<span class="keyword">const</span> <a class="code" href="control_8h.html#af3600af994b25be7c568791eefdadf2e">Control::Control</a> &amp;control)<span class="keyword"> const </span>{</div><div class="line"><a name="l00251"></a><span class="lineno">  251</span>&#160;    <a class="code" href="data__type_8h.html#a7c99d9360fc6cac2762b786e2fb52266">decimal_t</a> j = 0;</div><div class="line"><a name="l00252"></a><span class="lineno">  252</span>&#160;    <span class="keywordflow">for</span> (<span class="keyword">const</span> <span class="keyword">auto</span> &amp;seg : segs) j += seg.J(control);</div><div class="line"><a name="l00253"></a><span class="lineno">  253</span>&#160;    <span class="keywordflow">return</span> j;</div><div class="line"><a name="l00254"></a><span class="lineno">  254</span>&#160;  }</div><div class="line"><a name="l00255"></a><span class="lineno">  255</span>&#160;</div><div class="line"><a name="l00262"></a><span class="lineno"><a class="line" href="classTrajectory.html#abbd2605d622c7e3fc6556f88d686bf02">  262</a></span>&#160;  <a class="code" href="data__type_8h.html#a7c99d9360fc6cac2762b786e2fb52266">decimal_t</a> <a class="code" href="classTrajectory.html#abbd2605d622c7e3fc6556f88d686bf02">Jyaw</a>()<span class="keyword"> const </span>{</div><div class="line"><a name="l00263"></a><span class="lineno">  263</span>&#160;    <a class="code" href="data__type_8h.html#a7c99d9360fc6cac2762b786e2fb52266">decimal_t</a> j = 0;</div><div class="line"><a name="l00264"></a><span class="lineno">  264</span>&#160;    <span class="keywordflow">for</span> (<span class="keyword">const</span> <span class="keyword">auto</span> &amp;seg : segs) j += seg.Jyaw();</div><div class="line"><a name="l00265"></a><span class="lineno">  265</span>&#160;    <span class="keywordflow">return</span> j;</div><div class="line"><a name="l00266"></a><span class="lineno">  266</span>&#160;  }</div><div class="line"><a name="l00267"></a><span class="lineno">  267</span>&#160;</div><div class="line"><a name="l00269"></a><span class="lineno"><a class="line" href="classTrajectory.html#afeeec35bf7962197b0a2aed260648760">  269</a></span>&#160;  std::vector&lt;decimal_t&gt; <a class="code" href="classTrajectory.html#afeeec35bf7962197b0a2aed260648760">getSegmentTimes</a>()<span class="keyword"> const </span>{</div><div class="line"><a name="l00270"></a><span class="lineno">  270</span>&#160;    std::vector&lt;decimal_t&gt; dts;</div><div class="line"><a name="l00271"></a><span class="lineno">  271</span>&#160;    <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i &lt; (int)Ts.size() - 1; i++)</div><div class="line"><a name="l00272"></a><span class="lineno">  272</span>&#160;      dts.push_back(Ts[i + 1] - Ts[i]);</div><div class="line"><a name="l00273"></a><span class="lineno">  273</span>&#160;    <span class="keywordflow">return</span> dts;</div><div class="line"><a name="l00274"></a><span class="lineno">  274</span>&#160;  }</div><div class="line"><a name="l00275"></a><span class="lineno">  275</span>&#160;</div><div class="line"><a name="l00277"></a><span class="lineno"><a class="line" href="classTrajectory.html#a90b4353fe2d9504c6645b7cafd70764f">  277</a></span>&#160;  <a class="code" href="data__type_8h.html#a6b9210d48a0a541940af71827aad1b41">vec_E&lt;Waypoint&lt;Dim&gt;</a>&gt; <a class="code" href="classTrajectory.html#a90b4353fe2d9504c6645b7cafd70764f">getWaypoints</a>()<span class="keyword"> const </span>{</div><div class="line"><a name="l00278"></a><span class="lineno">  278</span>&#160;    <a class="code" href="data__type_8h.html#a6b9210d48a0a541940af71827aad1b41">vec_E&lt;Waypoint&lt;Dim&gt;</a>&gt; ws;</div><div class="line"><a name="l00279"></a><span class="lineno">  279</span>&#160;    <span class="keywordflow">if</span> (segs.empty()) <span class="keywordflow">return</span> ws;</div><div class="line"><a name="l00280"></a><span class="lineno">  280</span>&#160;    <a class="code" href="data__type_8h.html#a7c99d9360fc6cac2762b786e2fb52266">decimal_t</a> t = 0;</div><div class="line"><a name="l00281"></a><span class="lineno">  281</span>&#160;    <span class="keywordflow">for</span> (<span class="keyword">const</span> <span class="keyword">auto</span> &amp;seg : segs) {</div><div class="line"><a name="l00282"></a><span class="lineno">  282</span>&#160;      ws.push_back(seg.evaluate(0));</div><div class="line"><a name="l00283"></a><span class="lineno">  283</span>&#160;      ws.back().t = t;</div><div class="line"><a name="l00284"></a><span class="lineno">  284</span>&#160;      t += seg.t();</div><div class="line"><a name="l00285"></a><span class="lineno">  285</span>&#160;    }</div><div class="line"><a name="l00286"></a><span class="lineno">  286</span>&#160;    ws.push_back(segs.back().evaluate(segs.back().t()));</div><div class="line"><a name="l00287"></a><span class="lineno">  287</span>&#160;    ws.back().t = t;</div><div class="line"><a name="l00288"></a><span class="lineno">  288</span>&#160;    <span class="keywordflow">return</span> ws;</div><div class="line"><a name="l00289"></a><span class="lineno">  289</span>&#160;  }</div><div class="line"><a name="l00290"></a><span class="lineno">  290</span>&#160;</div><div class="line"><a name="l00292"></a><span class="lineno"><a class="line" href="classTrajectory.html#a00a45bb81773cff30c3f7f6af6fd1a02">  292</a></span>&#160;  <a class="code" href="data__type_8h.html#a6b9210d48a0a541940af71827aad1b41">vec_E&lt;Primitive&lt;Dim&gt;</a>&gt; <a class="code" href="classTrajectory.html#a00a45bb81773cff30c3f7f6af6fd1a02">getPrimitives</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> segs; }</div><div class="line"><a name="l00293"></a><span class="lineno">  293</span>&#160;</div><div class="line"><a name="l00297"></a><span class="lineno"><a class="line" href="classTrajectory.html#a2c8a21095d260d7b8e4226c37fe56379">  297</a></span>&#160;  <a class="code" href="classLambda.html">Lambda</a> <a class="code" href="classTrajectory.html#a2c8a21095d260d7b8e4226c37fe56379">lambda</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> lambda_; }</div><div class="line"><a name="l00298"></a><span class="lineno">  298</span>&#160;</div><div class="line"><a name="l00300"></a><span class="lineno"><a class="line" href="classTrajectory.html#a93f4d5f86feb5f56e5fae7fd02311e9c">  300</a></span>&#160;  <a class="code" href="data__type_8h.html#a7c99d9360fc6cac2762b786e2fb52266">decimal_t</a> <a class="code" href="classTrajectory.html#a93f4d5f86feb5f56e5fae7fd02311e9c">getTotalTime</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> total_t_; }</div><div class="line"><a name="l00301"></a><span class="lineno">  301</span>&#160;</div><div class="line"><a name="l00303"></a><span class="lineno"><a class="line" href="classTrajectory.html#a1740804394e9c3d87e1cb86fd8034a20">  303</a></span>&#160;  <a class="code" href="data__type_8h.html#a6b9210d48a0a541940af71827aad1b41">vec_E&lt;Primitive&lt;Dim&gt;</a>&gt; <a class="code" href="classTrajectory.html#a1740804394e9c3d87e1cb86fd8034a20">segs</a>;</div><div class="line"><a name="l00305"></a><span class="lineno"><a class="line" href="classTrajectory.html#a283d2293df0bdb4b525e403b6cd8eb10">  305</a></span>&#160;  std::vector&lt;decimal_t&gt; <a class="code" href="classTrajectory.html#a283d2293df0bdb4b525e403b6cd8eb10">taus</a>;</div><div class="line"><a name="l00307"></a><span class="lineno"><a class="line" href="classTrajectory.html#a29224a22e9c3b698a2d3645e234eb22f">  307</a></span>&#160;  std::vector&lt;decimal_t&gt; <a class="code" href="classTrajectory.html#a29224a22e9c3b698a2d3645e234eb22f">Ts</a>;</div><div class="line"><a name="l00309"></a><span class="lineno"><a class="line" href="classTrajectory.html#a08e10efee7e33c2618bb7727fa2d034b">  309</a></span>&#160;  <a class="code" href="data__type_8h.html#a7c99d9360fc6cac2762b786e2fb52266">decimal_t</a> <a class="code" href="classTrajectory.html#a08e10efee7e33c2618bb7727fa2d034b">total_t_</a>;</div><div class="line"><a name="l00311"></a><span class="lineno"><a class="line" href="classTrajectory.html#a24a000bf7e3a68f675ea1e7470a32f34">  311</a></span>&#160;  <a class="code" href="classLambda.html">Lambda</a> <a class="code" href="classTrajectory.html#a24a000bf7e3a68f675ea1e7470a32f34">lambda_</a>;</div><div class="line"><a name="l00312"></a><span class="lineno">  312</span>&#160;};</div><div class="line"><a name="l00313"></a><span class="lineno">  313</span>&#160;</div><div class="line"><a name="l00315"></a><span class="lineno"><a class="line" href="trajectory_8h.html#aa445083de7adeca74e1334bc6f13ec9c">  315</a></span>&#160;<span class="keyword">typedef</span> <a class="code" href="classTrajectory.html">Trajectory&lt;2&gt;</a> <a class="code" href="trajectory_8h.html#aa445083de7adeca74e1334bc6f13ec9c">Trajectory2D</a>;</div><div class="line"><a name="l00316"></a><span class="lineno">  316</span>&#160;</div><div class="line"><a name="l00318"></a><span class="lineno"><a class="line" href="trajectory_8h.html#af41c290bd6b57629976d7e448abf6f92">  318</a></span>&#160;<span class="keyword">typedef</span> <a class="code" href="classTrajectory.html">Trajectory&lt;3&gt;</a> <a class="code" href="trajectory_8h.html#af41c290bd6b57629976d7e448abf6f92">Trajectory3D</a>;</div><div class="line"><a name="l00319"></a><span class="lineno">  319</span>&#160;</div><div class="line"><a name="l00320"></a><span class="lineno">  320</span>&#160;<span class="preprocessor">#endif</span></div><div class="ttc" id="classTrajectory_html_aec62c9d9b1a35202df2072ea3efcef09"><div class="ttname"><a href="classTrajectory.html#aec62c9d9b1a35202df2072ea3efcef09">Trajectory::evaluate</a></div><div class="ttdeci">Waypoint&lt; Dim &gt; evaluate(decimal_t time) const</div><div class="ttdoc">Evaluate Waypoint at time . </div><div class="ttdef"><b>Definition:</b> trajectory.h:67</div></div>
<div class="ttc" id="classLambda_html"><div class="ttname"><a href="classLambda.html">Lambda</a></div><div class="ttdoc">piecewise polynomial for scaling trajectory </div><div class="ttdef"><b>Definition:</b> lambda.h:73</div></div>
<div class="ttc" id="classTrajectory_html_a24a000bf7e3a68f675ea1e7470a32f34"><div class="ttname"><a href="classTrajectory.html#a24a000bf7e3a68f675ea1e7470a32f34">Trajectory::lambda_</a></div><div class="ttdeci">Lambda lambda_</div><div class="ttdoc">Scaling object. </div><div class="ttdef"><b>Definition:</b> trajectory.h:311</div></div>
<div class="ttc" id="primitive_8h_html"><div class="ttname"><a href="primitive_8h.html">primitive.h</a></div><div class="ttdoc">Primitive classes. </div></div>
<div class="ttc" id="structCommand_html_a15c98ad12c57dc0a5cb0c2fc6ce8f039"><div class="ttname"><a href="structCommand.html#a15c98ad12c57dc0a5cb0c2fc6ce8f039">Command::yaw</a></div><div class="ttdeci">decimal_t yaw</div><div class="ttdoc">yaw </div><div class="ttdef"><b>Definition:</b> trajectory.h:25</div></div>
<div class="ttc" id="structCommand_html_a1a0a22e1fece01c1b74e7d866197d90c"><div class="ttname"><a href="structCommand.html#a1a0a22e1fece01c1b74e7d866197d90c">Command::acc</a></div><div class="ttdeci">Vecf&lt; Dim &gt; acc</div><div class="ttdoc">acceleration in  </div><div class="ttdef"><b>Definition:</b> trajectory.h:23</div></div>
<div class="ttc" id="classTrajectory_html_a5e1f42b3d5a4efa3ec52e9ffebb5504d"><div class="ttname"><a href="classTrajectory.html#a5e1f42b3d5a4efa3ec52e9ffebb5504d">Trajectory::J</a></div><div class="ttdeci">decimal_t J(const Control::Control &amp;control) const</div><div class="ttdoc">Return total efforts of Primitive for the given duration: . </div><div class="ttdef"><b>Definition:</b> trajectory.h:250</div></div>
<div class="ttc" id="classTrajectory_html_a00a45bb81773cff30c3f7f6af6fd1a02"><div class="ttname"><a href="classTrajectory.html#a00a45bb81773cff30c3f7f6af6fd1a02">Trajectory::getPrimitives</a></div><div class="ttdeci">vec_E&lt; Primitive&lt; Dim &gt; &gt; getPrimitives() const</div><div class="ttdoc">Get Primitive array. </div><div class="ttdef"><b>Definition:</b> trajectory.h:292</div></div>
<div class="ttc" id="structWaypoint_html_a7966bc3955c4c0f880eea35a76e4c8ed"><div class="ttname"><a href="structWaypoint.html#a7966bc3955c4c0f880eea35a76e4c8ed">Waypoint::jrk</a></div><div class="ttdeci">Vecf&lt; Dim &gt; jrk</div><div class="ttdoc">jerk in  </div><div class="ttdef"><b>Definition:</b> waypoint.h:35</div></div>
<div class="ttc" id="structWaypoint_html_ad5c2f2b8f6dba96bb93faccde844e9a8"><div class="ttname"><a href="structWaypoint.html#ad5c2f2b8f6dba96bb93faccde844e9a8">Waypoint::yaw</a></div><div class="ttdeci">decimal_t yaw</div><div class="ttdoc">yaw </div><div class="ttdef"><b>Definition:</b> waypoint.h:36</div></div>
<div class="ttc" id="classTrajectory_html_a1740804394e9c3d87e1cb86fd8034a20"><div class="ttname"><a href="classTrajectory.html#a1740804394e9c3d87e1cb86fd8034a20">Trajectory::segs</a></div><div class="ttdeci">vec_E&lt; Primitive&lt; Dim &gt; &gt; segs</div><div class="ttdoc">Segments of primitives. </div><div class="ttdef"><b>Definition:</b> trajectory.h:303</div></div>
<div class="ttc" id="classTrajectory_html_a283d2293df0bdb4b525e403b6cd8eb10"><div class="ttname"><a href="classTrajectory.html#a283d2293df0bdb4b525e403b6cd8eb10">Trajectory::taus</a></div><div class="ttdeci">std::vector&lt; decimal_t &gt; taus</div><div class="ttdoc">Time in virtual domain. </div><div class="ttdef"><b>Definition:</b> trajectory.h:305</div></div>
<div class="ttc" id="classTrajectory_html_a29224a22e9c3b698a2d3645e234eb22f"><div class="ttname"><a href="classTrajectory.html#a29224a22e9c3b698a2d3645e234eb22f">Trajectory::Ts</a></div><div class="ttdeci">std::vector&lt; decimal_t &gt; Ts</div><div class="ttdoc">Time in actual domain. </div><div class="ttdef"><b>Definition:</b> trajectory.h:307</div></div>
<div class="ttc" id="classTrajectory_html_a5f54099ed3abd448c571b20200f42b3a"><div class="ttname"><a href="classTrajectory.html#a5f54099ed3abd448c571b20200f42b3a">Trajectory::scale</a></div><div class="ttdeci">bool scale(decimal_t ri, decimal_t rf)</div><div class="ttdoc">Scale according to ratio at start and end (velocity only) </div><div class="ttdef"><b>Definition:</b> trajectory.h:140</div></div>
<div class="ttc" id="structWaypoint_html"><div class="ttname"><a href="structWaypoint.html">Waypoint</a></div><div class="ttdoc">Waypoint base class. </div><div class="ttdef"><b>Definition:</b> waypoint.h:23</div></div>
<div class="ttc" id="structCommand_html"><div class="ttname"><a href="structCommand.html">Command</a></div><div class="ttdoc">Command class. </div><div class="ttdef"><b>Definition:</b> trajectory.h:20</div></div>
<div class="ttc" id="classTrajectory_html_a93f4d5f86feb5f56e5fae7fd02311e9c"><div class="ttname"><a href="classTrajectory.html#a93f4d5f86feb5f56e5fae7fd02311e9c">Trajectory::getTotalTime</a></div><div class="ttdeci">decimal_t getTotalTime() const</div><div class="ttdoc">Get the total duration of Trajectory. </div><div class="ttdef"><b>Definition:</b> trajectory.h:300</div></div>
<div class="ttc" id="classTrajectory_html_afeeec35bf7962197b0a2aed260648760"><div class="ttname"><a href="classTrajectory.html#afeeec35bf7962197b0a2aed260648760">Trajectory::getSegmentTimes</a></div><div class="ttdeci">std::vector&lt; decimal_t &gt; getSegmentTimes() const</div><div class="ttdoc">Get time of each segment. </div><div class="ttdef"><b>Definition:</b> trajectory.h:269</div></div>
<div class="ttc" id="trajectory_8h_html_af41c290bd6b57629976d7e448abf6f92"><div class="ttname"><a href="trajectory_8h.html#af41c290bd6b57629976d7e448abf6f92">Trajectory3D</a></div><div class="ttdeci">Trajectory&lt; 3 &gt; Trajectory3D</div><div class="ttdoc">Trajectory in 3D. </div><div class="ttdef"><b>Definition:</b> trajectory.h:318</div></div>
<div class="ttc" id="trajectory_8h_html_a584da4e5e2d62a2f438ce837015884e1"><div class="ttname"><a href="trajectory_8h.html#a584da4e5e2d62a2f438ce837015884e1">Command2D</a></div><div class="ttdeci">Command&lt; 2 &gt; Command2D</div><div class="ttdoc">Command 2D. </div><div class="ttdef"><b>Definition:</b> trajectory.h:31</div></div>
<div class="ttc" id="classTrajectory_html"><div class="ttname"><a href="classTrajectory.html">Trajectory</a></div><div class="ttdoc">Trajectory class. </div><div class="ttdef"><b>Definition:</b> trajectory.h:43</div></div>
<div class="ttc" id="classTrajectory_html_a08e10efee7e33c2618bb7727fa2d034b"><div class="ttname"><a href="classTrajectory.html#a08e10efee7e33c2618bb7727fa2d034b">Trajectory::total_t_</a></div><div class="ttdeci">decimal_t total_t_</div><div class="ttdoc">Total time of the trajectory. </div><div class="ttdef"><b>Definition:</b> trajectory.h:309</div></div>
<div class="ttc" id="classTrajectory_html_a9bedf803b27daaca08d0e049a17fa41a"><div class="ttname"><a href="classTrajectory.html#a9bedf803b27daaca08d0e049a17fa41a">Trajectory::scale_down</a></div><div class="ttdeci">bool scale_down(decimal_t mv, decimal_t ri, decimal_t rf)</div><div class="ttdoc">Scale down the whole trajectory according to mv. </div><div class="ttdef"><b>Definition:</b> trajectory.h:165</div></div>
<div class="ttc" id="math_8h_html_a8a7fd3c51a3512fb0e8f4d70f8a93fac"><div class="ttname"><a href="math_8h.html#a8a7fd3c51a3512fb0e8f4d70f8a93fac">power</a></div><div class="ttdeci">decimal_t power(decimal_t t, int n)</div><div class="ttdoc">Return . </div><div class="ttdef"><b>Definition:</b> math.h:197</div></div>
<div class="ttc" id="control_8h_html_af3600af994b25be7c568791eefdadf2e"><div class="ttname"><a href="control_8h.html#af3600af994b25be7c568791eefdadf2e">Control::Control</a></div><div class="ttdeci">Control</div><div class="ttdoc">Enum for control input. </div><div class="ttdef"><b>Definition:</b> control.h:10</div></div>
<div class="ttc" id="classTrajectory_html_a90b4353fe2d9504c6645b7cafd70764f"><div class="ttname"><a href="classTrajectory.html#a90b4353fe2d9504c6645b7cafd70764f">Trajectory::getWaypoints</a></div><div class="ttdeci">vec_E&lt; Waypoint&lt; Dim &gt; &gt; getWaypoints() const</div><div class="ttdoc">Get intermediate Waypoint on the trajectory. </div><div class="ttdef"><b>Definition:</b> trajectory.h:277</div></div>
<div class="ttc" id="structWaypoint_html_a648217ed387d4e226bec8ecb05bfefe8"><div class="ttname"><a href="structWaypoint.html#a648217ed387d4e226bec8ecb05bfefe8">Waypoint::acc</a></div><div class="ttdeci">Vecf&lt; Dim &gt; acc</div><div class="ttdoc">acceleration in  </div><div class="ttdef"><b>Definition:</b> waypoint.h:34</div></div>
<div class="ttc" id="data__type_8h_html_a6b9210d48a0a541940af71827aad1b41"><div class="ttname"><a href="data__type_8h.html#a6b9210d48a0a541940af71827aad1b41">vec_E</a></div><div class="ttdeci">std::vector&lt; T, Eigen::aligned_allocator&lt; T &gt; &gt; vec_E</div><div class="ttdoc">Pre-allocated std::vector for Eigen using vec_E. </div><div class="ttdef"><b>Definition:</b> data_type.h:53</div></div>
<div class="ttc" id="lambda_8h_html"><div class="ttname"><a href="lambda_8h.html">lambda.h</a></div><div class="ttdoc">Lambda class. </div></div>
<div class="ttc" id="structWaypoint_html_a91393e0d8d73afb9df512710e56f02a5"><div class="ttname"><a href="structWaypoint.html#a91393e0d8d73afb9df512710e56f02a5">Waypoint::vel</a></div><div class="ttdeci">Vecf&lt; Dim &gt; vel</div><div class="ttdoc">velocity in  </div><div class="ttdef"><b>Definition:</b> waypoint.h:33</div></div>
<div class="ttc" id="classTrajectory_html_a2c8a21095d260d7b8e4226c37fe56379"><div class="ttname"><a href="classTrajectory.html#a2c8a21095d260d7b8e4226c37fe56379">Trajectory::lambda</a></div><div class="ttdeci">Lambda lambda() const</div><div class="ttdoc">Get the scaling factor Lambda. </div><div class="ttdef"><b>Definition:</b> trajectory.h:297</div></div>
<div class="ttc" id="structCommand_html_a67386b9f647b7830288fe09e2f1e2f94"><div class="ttname"><a href="structCommand.html#a67386b9f647b7830288fe09e2f1e2f94">Command::yaw_dot</a></div><div class="ttdeci">decimal_t yaw_dot</div><div class="ttdoc">yaw velocity </div><div class="ttdef"><b>Definition:</b> trajectory.h:26</div></div>
<div class="ttc" id="data__type_8h_html_a7c99d9360fc6cac2762b786e2fb52266"><div class="ttname"><a href="data__type_8h.html#a7c99d9360fc6cac2762b786e2fb52266">decimal_t</a></div><div class="ttdeci">double decimal_t</div><div class="ttdoc">Rename the float type used in lib. </div><div class="ttdef"><b>Definition:</b> data_type.h:49</div></div>
<div class="ttc" id="structCommand_html_a90de7cf427b5cba982ac95543e2415f0"><div class="ttname"><a href="structCommand.html#a90de7cf427b5cba982ac95543e2415f0">Command::pos</a></div><div class="ttdeci">Vecf&lt; Dim &gt; pos</div><div class="ttdoc">position in  </div><div class="ttdef"><b>Definition:</b> trajectory.h:21</div></div>
<div class="ttc" id="trajectory_8h_html_aa445083de7adeca74e1334bc6f13ec9c"><div class="ttname"><a href="trajectory_8h.html#aa445083de7adeca74e1334bc6f13ec9c">Trajectory2D</a></div><div class="ttdeci">Trajectory&lt; 2 &gt; Trajectory2D</div><div class="ttdoc">Trajectory in 2D. </div><div class="ttdef"><b>Definition:</b> trajectory.h:315</div></div>
<div class="ttc" id="classTrajectory_html_a28d57dbc2b417e504bede1abbd772544"><div class="ttname"><a href="classTrajectory.html#a28d57dbc2b417e504bede1abbd772544">Trajectory::Trajectory</a></div><div class="ttdeci">Trajectory()</div><div class="ttdoc">Empty constructor. </div><div class="ttdef"><b>Definition:</b> trajectory.h:48</div></div>
<div class="ttc" id="classTrajectory_html_a25ec384d286281c81480dee1b2f7bffe"><div class="ttname"><a href="classTrajectory.html#a25ec384d286281c81480dee1b2f7bffe">Trajectory::sample</a></div><div class="ttdeci">vec_E&lt; Command&lt; Dim &gt; &gt; sample(int N) const</div><div class="ttdoc">Sample N+1 Command along trajectory using uniformed time. </div><div class="ttdef"><b>Definition:</b> trajectory.h:230</div></div>
<div class="ttc" id="classTrajectory_html_a261644c545eae2262753edb6aab27798"><div class="ttname"><a href="classTrajectory.html#a261644c545eae2262753edb6aab27798">Trajectory::Trajectory</a></div><div class="ttdeci">Trajectory(const vec_E&lt; Primitive&lt; Dim &gt;&gt; &amp;prs)</div><div class="ttdoc">Construct from multiple primitives. </div><div class="ttdef"><b>Definition:</b> trajectory.h:52</div></div>
<div class="ttc" id="structCommand_html_a93524fa85b9db75468e838e1dabc8b89"><div class="ttname"><a href="structCommand.html#a93524fa85b9db75468e838e1dabc8b89">Command::jrk</a></div><div class="ttdeci">Vecf&lt; Dim &gt; jrk</div><div class="ttdoc">jerk in  </div><div class="ttdef"><b>Definition:</b> trajectory.h:24</div></div>
<div class="ttc" id="structVirtualPoint_html"><div class="ttname"><a href="structVirtualPoint.html">VirtualPoint</a></div><div class="ttdoc">Used for scaling, ignored for most case. </div><div class="ttdef"><b>Definition:</b> lambda.h:16</div></div>
<div class="ttc" id="data__type_8h_html_a3a0c45655a5e009e56634ccde0c5c575"><div class="ttname"><a href="data__type_8h.html#a3a0c45655a5e009e56634ccde0c5c575">Vecf</a></div><div class="ttdeci">Eigen::Matrix&lt; decimal_t, N, 1 &gt; Vecf</div><div class="ttdoc">Eigen 1D float vector of size N. </div><div class="ttdef"><b>Definition:</b> data_type.h:56</div></div>
<div class="ttc" id="data__type_8h_html_a885809dc84c0c55d44fe4836f5cfa39b"><div class="ttname"><a href="data__type_8h.html#a885809dc84c0c55d44fe4836f5cfa39b">Vec4f</a></div><div class="ttdeci">Vecf&lt; 4 &gt; Vec4f</div><div class="ttdoc">Eigen 1D float vector of size 4. </div><div class="ttdef"><b>Definition:</b> data_type.h:84</div></div>
<div class="ttc" id="classPrimitive_html"><div class="ttname"><a href="classPrimitive.html">Primitive</a></div><div class="ttdoc">Primitive class. </div><div class="ttdef"><b>Definition:</b> primitive.h:206</div></div>
<div class="ttc" id="trajectory_8h_html_a630e8754d18d9d0b2e32fe0cecd3fe3d"><div class="ttname"><a href="trajectory_8h.html#a630e8754d18d9d0b2e32fe0cecd3fe3d">Command3D</a></div><div class="ttdeci">Command&lt; 3 &gt; Command3D</div><div class="ttdoc">Command 3D. </div><div class="ttdef"><b>Definition:</b> trajectory.h:34</div></div>
<div class="ttc" id="structWaypoint_html_af63de420a521f105eea4ce098a51ad7e"><div class="ttname"><a href="structWaypoint.html#af63de420a521f105eea4ce098a51ad7e">Waypoint::pos</a></div><div class="ttdeci">Vecf&lt; Dim &gt; pos</div><div class="ttdoc">position in  </div><div class="ttdef"><b>Definition:</b> waypoint.h:32</div></div>
<div class="ttc" id="structCommand_html_a6a7db4d1eb44141050e3c7dc691b1732"><div class="ttname"><a href="structCommand.html#a6a7db4d1eb44141050e3c7dc691b1732">Command::vel</a></div><div class="ttdeci">Vecf&lt; Dim &gt; vel</div><div class="ttdoc">velocity in  </div><div class="ttdef"><b>Definition:</b> trajectory.h:22</div></div>
<div class="ttc" id="classTrajectory_html_a4a31376506a13df82691e2f67125f25e"><div class="ttname"><a href="classTrajectory.html#a4a31376506a13df82691e2f67125f25e">Trajectory::evaluate</a></div><div class="ttdeci">bool evaluate(decimal_t time, Command&lt; Dim &gt; &amp;p) const</div><div class="ttdoc">Evaluate Command at , return false if fails to evaluate. </div><div class="ttdef"><b>Definition:</b> trajectory.h:99</div></div>
<div class="ttc" id="classTrajectory_html_abbd2605d622c7e3fc6556f88d686bf02"><div class="ttname"><a href="classTrajectory.html#abbd2605d622c7e3fc6556f88d686bf02">Trajectory::Jyaw</a></div><div class="ttdeci">decimal_t Jyaw() const</div><div class="ttdoc">Return total yaw efforts for the given duration: . </div><div class="ttdef"><b>Definition:</b> trajectory.h:262</div></div>
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.13
</small></address>
</body>
</html>
